<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>课题管理</title>
<%@ include file="/module/js.jsp"%>
</head>
<body>
	<form action="#" name="Form" id="Form" method="post">
		<input type="hidden" name="idList" id="idList" />
		<%@ include file="/module/orderField.jsp"%>
		<table cellpadding="1" cellspacing="1" border="0">
			<tr>
				<td><input type="button" id="btnQuery" value="查询"
					class="inputButton" /></td>

				<kl:permission permisstionList="${permisstionList}"
					currentUser="${_login_console_user}"
					currentCatalogId="<%=CatalogUtils.getCatalogId(\"JKY_JKS_TJLW\")%>"
					key="add">
					<td><input type="button" id="btnAdd" value="添 加"
						class="inputButton" /></td>
				</kl:permission>

				<kl:permission permisstionList="${permisstionList}"
					currentUser="${_login_console_user}"
					currentCatalogId="<%=CatalogUtils.getCatalogId(\"JKY_JKS_TJLW\")%>"
					key="delete">
					<td><input type="button" id="btnDelete" value="删 除"
						class="inputButton" /></td>
				</kl:permission>

				<td><input type="button" id="btnExport" value="导出"
					class="inputButton" /></td>
			</tr>
		</table>

		<table cellpadding="1" cellspacing="1">
			<tr>
				<td>审批结果：</td>
				<td align="left"><select id="tjjg" name="tjjg"
					class="selectList2">
						<option value="">全部</option>
						<option value="推荐">推荐</option>
						<option value="不推荐">不推荐</option>
				</select></td>
				<td>题目：</td>
				<td><input type="text" name="subject" id="subject" value=""
					autocomplete="off" class="inputText2" /></td>
				<td>获奖级别：</td>
				<td><input type="text" name="hjjb" id="hjjb" value=""
					autocomplete="off" class="inputText2" /></td>
			</tr>
			<tr>
				<td>提交日期：</td>
				<td colspan="3"><input type="text" name="startTime"
					id="startTime" autocomplete="off" class="Wdate inputText2" value=""
					onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />&nbsp;到 <input
					type="text" name="endTime" id="endTime" autocomplete="off"
					class="Wdate inputText2" value=""
					onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>

			</tr>
		</table>


		<table id="dg" style="width: 100%;"
			data-options="pagination:true,collapsible:true,url:'${basePath}/teacherThesis/list',method:'post',remoteSort:true">
			<thead>
				<tr>
					<th
						data-options="field:'lwid',checkbox:true,width:80,align:'center'"></th>
					<th
						data-options="field:'subject',nowrap:true,width:200,align:'center',sortable:true,formatter:go2Info">论文题目</th>
					<th
						data-options="field:'lwsj',nowrap:true,width:300,align:'center',sortable:true">论文时间</th>
					<th
						data-options="field:'tjjg',nowrap:true,width:150,align:'center',sortable:true">推荐结果</th>
					<th
						data-options="field:'hjjb',nowrap:true,width:200,align:'center',sortable:true">获奖级别</th>
					<th
						data-options="field:'createTime',nowrap:true,width:200,align:'center',sortable:true,formatter:formatDate">提交时间</th>
				</tr>
			</thead>
		</table>
	</form>
	<script type="text/javascript">
		$(document).ready(
			function() {

			$('#dg').datagrid({
			   rowStyler: function(index,row){
			   },
			   onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
	           		if (data.rows.length > 0) {
					}
				},
			});
			//查询
			$('#btnQuery').click(function(){
				$('#dg').datagrid('load',{
					tjjg : $('#tjjg').val(),
					subject : $('#subject').val(),
					hjjb : $('#hjjb').val(),
					startTime: $('#startTime').val(),
					endTime: $('#endTime').val()
				});
			});
			// 导出
			$('#btnExport').on('click', function(){
				layer.confirm("您确定要导出吗?", function(index){
					document.Form.action = "${basePath}/teacherThesis/export_teacherThesis";
					document.Form.submit();
					layer.close(index);
				});
			});
	 		$('#easyui-ck').click(function() {
				var data = $("#dg").datagrid("getSelections");
				for (var i = 0; i < data.length; i++) {
            	}
			});
			$('#btnAdd').click(function() {
				window.location.href = "${basePath}/teacherThesis/addInInt";
			});
			$('#btnDelete').click(function() {
			   $("#idList").val("");
				var count = 0;
				var idList = new Array();
				var sels = $("#dg").datagrid("getSelections");
				for(var i in sels){
					idList.push(sels[i].lwid);
					count++;
				}

				if (count == 0) {
					layer.alert("您至少选择一条删除记录信息", {icon: 3});
					return false;
				}else{
					  layer.confirm("您是否删除当前选中数据信息", {icon: 3, title:'提示',skin:'layer-ext-moon'}, function(index){
							$("#idList").val(idList);
							document.Form.action = "${basePath}/teacherThesis/delete";
							document.Form.submit();
					  },function(index){
							layer.close(index);
					  });
				}
			});
		});
		if("${msg}"!=""){
		   layer.alert("${msg}", {icon: 6});
		}


		function go2Info(value, row, index) {
			return "<a href='${basePath}/teacherThesis/info?id=" + row.lwid + "'>" + value + "</a>";
		}
	</script>
</body>
</html>
